<template>
  <el-form-item :label="description.label">
    <el-input v-model="modelValue.value" :placeholder="description.placeholder || ''" :key="description.key" @input="(v)=>{
      $emit('update:modelValue',{
        key: description.key,
        value: v
      })
    }" />
  </el-form-item>
</template>

<script setup lang="ts">
import type { FPInputDescription } from '@/components/function-parameter/fp-input/index'

defineEmits(['update:modelValue'])

defineProps({
  modelValue: {
    type: Object as () => { key: string; value: string },
    required: true
  },
  description: {
    type: Object as () => FPInputDescription,
    required: true
  }
})
</script>

<style scoped lang="scss"></style>
